<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/2 0002
 * Time: 9:29
 */

abstract class AlipayTradeBuilder
{
    protected $params = array();
    /**
     * @return string 获取服务名称
     */
    public abstract function getServiceName();

    /**
     * 获取业务参数
     * @return array
     */
    public function getBizContent()
    {
        return array_filter($this->params,function($v){ return !empty($v);});
    }
    /**
     * 获取当前系统时间戳
     * @return float
     */
    public function getMillisecond()
    {
        list($t1, $t2) = explode(' ', microtime());
        return (float)sprintf('%.0f',(floatval($t1)+floatval($t2))*1000);
    }
}